package com.hopes.bizz.emergency.statistic.controller;


import com.hopes.bizz.emergency.drill.dto.ErEmergencyDrillDTO;
import com.hopes.bizz.emergency.statistic.serivce.GisService;
import com.hopes.boss.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cx
 * @Description 一张图统计接口
 * @time 2024/1/17 9:31
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/gisStatistic" )
@Tag(description = "gis" , name = "一张图统计接口" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class GISController {

    private final GisService gisService;

    @GetMapping(value = "/emergencyPlanLevel")
    @Operation(summary = "应急预案级别", description = "应急预案级别")
    public R emergencyPlanLevel() {
        return R.ok(gisService.emergencyPlanLevel());
    }

    @GetMapping(value = "/emergencyPlanHazard")
    @Operation(summary = "企业应急预案重大危险源", description = "企业应急预案重大危险源")
    public R emergencyPlanHazard() {
        return R.ok(gisService.emergencyPlanHazard());
    }

    @GetMapping(value = "/emergencyCompanyPlanState")
    @Operation(summary = "企业应急预案状态", description = "企业应急预案状态")
    public R emergencyCompanyPlanState() {
        return R.ok(gisService.emergencyCompanyPlanState());
    }

    @GetMapping(value = "/emergencyWarehouseLevel")
    @Operation(summary = "应急仓库级别", description = "应急仓库级别")
    public R emergencyWarehouseLevel() {
        return R.ok(gisService.emergencyWarehouseLevel());
    }
    @GetMapping(value = "/emergencyMaterialOverdueStatus")
    @Operation(summary = "应急物资过期状态", description = "应急物资过期状态")
    public R emergencyMaterialOverdueStatus() {
        return R.ok(gisService.emergencyMaterialOverdueStatus());
    }

    @GetMapping(value = "/emergencyCarOverdueStatus")
    @Operation(summary = "应急车辆过期状态", description = "应急车辆过期状态")
    public R emergencyCarOverdueStatus() {
        return R.ok(gisService.emergencyCarOverdueStatus());
    }

    @GetMapping(value = "/emergencyTeamOverdueStatus")
    @Operation(summary = "应急队伍过期状态", description = "应急队伍过期状态")
    public R emergencyTeamOverdueStatus() {
        return R.ok(gisService.emergencyTeamOverdueStatus());
    }

    @GetMapping(value = "/emergencyMaterialEqType")
    @Operation(summary = "应急物资类别", description = "应急物资类别")
    public R emergencyMaterialEqType() {
        return R.ok(gisService.emergencyMaterialEqType());
    }

    @GetMapping(value = "/emergencyCarType")
    @Operation(summary = "应急车辆类别", description = "应急车辆类别")
    public R emergencyCarTypeStatus() {
        return R.ok(gisService.emergencyCarType());
    }

    @GetMapping(value = "/emergencyTeamType")
    @Operation(summary = "应急队伍类别", description = "应急队伍类别")
    public R emergencyTeamType() {
        return R.ok(gisService.emergencyTeamType());
    }

    @GetMapping(value = "/emergencyProtectTargetType")
    @Operation(summary = "应急保护对象类别", description = "应急保护对象类别")
    public R emergencyProtectTargetType() {
        return R.ok(gisService.emergencyProtectTargetType());
    }

    @GetMapping(value = "/emergencyCompanyDrillStatistic")
    @Operation(summary = "企业应急演练年度汇总", description = "企业应急演练年度汇总")
    public R emergencyCompanyDrillStatistic(ErEmergencyDrillDTO dto) {
        return R.ok(gisService.emergencyCompanyDrillStatistic(dto));
    }

    @GetMapping(value = "/emergencyCompanyDrillPopulation/{year}")
    @Operation(summary = "企业应急演练年度人数", description = "企业应急演练年度人数")
    public R emergencyCompanyDrillPopulation(@PathVariable Integer year) {
        return R.ok(gisService.emergencyCompanyDrillPopulation(year));
    }

    @GetMapping(value = "/emergencyCompanyDrillTable/{year}")
    @Operation(summary = "企业应急演练年度表格", description = "企业应急演练表格")
    public R emergencyCompanyDrillTable(@PathVariable Integer year) {
        return R.ok(gisService.emergencyCompanyDrillTable(year));
    }

}
